package com.changli02.singleton;

public class BankTest {
    public static void main(String[] args) {
        Bank b1 = Bank.getInstance();
    }
}



//饿汉式 单线程
class Bank{
    //构造器私有化
    private Bank(){

    }
    private static  Bank instance = new Bank();
    public static Bank getInstance(){
        return instance;
    }
}
